package com.mogist.hqc.module.personal.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.mogist.hqc.R
import com.mogist.hqc.entitys.response.MyCommunityVo
import talex.zsw.basecore.util.DataTool
import talex.zsw.basecore.util.glide.GlideApp

/**
 * 作用：我的帖子
 * 作者：赵小白 email:vvtale@gmail.com  
 * 修改人：
 * 修改时间：
 * 修改备注：
 */
class MyCommunityAdapter : BaseQuickAdapter<MyCommunityVo, BaseViewHolder>(R.layout.item_my_community)
{
    override fun convert(helper: BaseViewHolder, item: MyCommunityVo)
    { //iTvTitle iTvContent iIvMore iIcon iTvName iTvTime iTvRead iTvComment
        // iLLDetail
        helper.setText(R.id.iTvTitle, item.title)
                .setText(R.id.iTvContent, item.content)
                .setText(R.id.iTvName, DataTool.formatPhone(item.userName))
                .setText(R.id.iTvTime, item.createTime)
                .setText(R.id.iTvRead, item.viewNum)
                .setText(R.id.iTvComment, item.sayNum)
                .addOnClickListener(R.id.iIvMore)
                .addOnClickListener(R.id.iLLDetail)
        GlideApp.with(mContext)
                .load(item.userHead)
                .centerCrop()
                .into(helper.getView(R.id.iIcon))
    }
}